<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>分类</title>
       <link rel="stylesheet" href="../static/css/me.css">
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css" >
</head>
<body>
<!--导航-->
<nav th:replace="_fragments :: menu(2)" class="ui inverted attached segment m-padded-tb-mini m-shadow-small" >
    <div class="ui container">
        <div class="ui stackable inverted secondary menu">
            <h2 class="ui teal header item">Blog</h2>
            <a href="#" class="m-item m-mobile-hide item"><i class="home icon"></i>首页</a>
            <a href="#" class="m-item m-mobile-hide item"><i class="idea icon"></i>分类</a>
            <a href="#" class="m-item m-mobile-hide item"><i class="tags icon"></i>标签</a>
            <a href="#" class="m-item m-mobile-hide item"><i class="clone icon"></i>归档</a>
            <a href="#" class="m-item m-mobile-hide item"><i class="info icon"></i>关于我</a>
            <div class="right m-item m-mobile-hide item">
                <div class="ui icon inverted transparent input">
                    <input type="text" placeholder="search">
                    <i class="search link icon"></i>
                </div>
            </div>
        </div>
    </div>
    <a href="#" class="ui menu toggle black icon button m-top-right  m-mobile-show">
        <i class="sidebar icon"></i>
    </a>
</nav>



<!--中间内容-->
<div class="m-container-small m-padded-tb-big">
    <div class="ui container">
<!--        header-->
        <div class="ui top attached segment ">
            <div class="ui middle aligned two column grid">
                <div class="column">
                    <h3 class="ui teal header">分类</h3>
                </div>
                <div class="right aligned column">
                    共 <h2 class="ui header orange m-inline-block m-text-thin" th:text="${#arrays.length(types)}">14</h2> 个
                </div>
            </div>
        </div>
        <div class="ui attached segment m-padded-tb-large">
            <div class="ui labeled button m-margin-tb-tiny" th:each="type : ${types}">
                <a href="#" th:href="@{/type/{id}(id=${type.id})}" class="ui basic button" th:classappend="${type.id == activeTypeId} ? 'teal'" th:text="${type.name}">思考与感悟</a>
                <div class="ui basic  left pointing label" th:classappend="${type.id == activeTypeId} ? 'teal'" th:text="${#arrays.length(type.blogs)}">12</div>
            </div>
<!--            <div class="ui labeled button m-margin-tb-tiny">-->
<!--                <a href="#" class="ui basic  button">思考与感悟</a>-->
<!--                <div class="ui basic  left pointing label">12</div>-->
<!--            </div>-->
<!--            <div class="ui labeled button m-margin-tb-tiny">-->
<!--                <a href="#" class="ui basic  button">思考与感悟</a>-->
<!--                <div class="ui basic  left pointing label">12</div>-->
<!--            </div>-->
<!--            <div class="ui labeled button m-margin-tb-tiny">-->
<!--                <a href="#" class="ui basic  button">思考与感悟</a>-->
<!--                <div class="ui basic  left pointing label">12</div>-->
<!--            </div>-->
<!--            <div class="ui labeled button m-margin-tb-tiny">-->
<!--                <a href="#" class="ui basic  button">思考与感悟</a>-->
<!--                <div class="ui basic  left pointing label">12</div>-->
<!--            </div>-->
<!--            <div class="ui labeled button m-margin-tb-tiny">-->
<!--                <a href="#" class="ui basic  button">思考与感悟</a>-->
<!--                <div class="ui basic  left pointing label">12</div>-->
<!--            </div>-->
<!--            <div class="ui labeled button m-margin-tb-tiny">-->
<!--                <a href="#" class="ui basic  button">思考与感悟</a>-->
<!--                <div class="ui basic  left pointing label">12</div>-->
<!--            </div>-->
<!--            <div class="ui labeled button m-margin-tb-tiny">-->
<!--                <a href="#" class="ui basic  button">思考与感悟</a>-->
<!--                <div class="ui basic  left pointing label">12</div>-->
<!--            </div>-->
<!--            <div class="ui labeled button m-margin-tb-tiny">-->
<!--                <a href="#" class="ui basic  button">思考与感悟</a>-->
<!--                <div class="ui basic  left pointing label">12</div>-->
<!--            </div>-->
        </div>

        <div class="ui top attached teal segment">

            <div class="ui padded  vertical m-text segment m-padded-tb-large" th:each="blog : ${page.content}" >
                <div class="ui middle aligned grid  mobile reversed stackable">
                    <div class="eleven wide column">
                        <h3 class="ui header"><a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank" class="m-black" th:text="${blog.title}">你真的理解什么是财富自由吗？</a></h3>
                        <p class="m-text-spaced" th:text="|${blog.description}.....|">简单说来，财富自由就是有足够多的时间和足够多的钱做你想做的事情。在“基本”的生活需求得到“持续”保障的前提下，有足够的资本可以“自由”的投入到“该”做的事情中！</p>
                        <div class="ui grid">
                            <div class="eleven wide column">
                                <div class="ui mini horizontal link list">
                                    <div class="item">
                                        <img src="https://unsplash.it/100/100?image=1005" th:src="@{${blog.user.avatar}}"  alt="" class="ui avatar image">
                                        <div class="content"><a href="#" class="header" th:text="${blog.user.nickName}" style="color: #00B5AD!important;">Mr.Li </a></div>
                                    </div>
                                    <div class="item">
                                        <i class="calendar icon"></i><span th:text="${#dates.format(blog.updateTime,'yyyy-MM-dd')}"></span>
                                    </div>
                                    <div class="item">
                                        <i class="eye icon"></i> <span th:text="${blog.views}"></span>
                                    </div>
                                </div>
                            </div>
                            <div class="five wide column">
                                <a href="#" target="_blank" th:href="@{/type/{id}(id=${blog.type.id}) }" class="ui teal basic label m-padded-tiny" th:text="${blog.type.name}">
                                    认知升级
                                </a>
                            </div>
                        </div>
                    </div>
                    <div class="five wide column">
                        <a href="#" target="_blank" th:href="@{/blog/{id}(id=${blog.id})}">
                            <img src="https://unsplash.it/800/450?image=1005" th:src="@{${blog.firstPicture}}" alt="" class="ui rounded image">
                        </a>
                    </div>
                </div>
            </div>


        </div>
<!--        上下页-->
        <div class="ui attached segment"  th:if="${page.totalPages}>1">
            <div class="ui middle aligned two column grid">
                <div class="column">
                    <a class="ui mini teal basic button" th:href="@{/admin/blogs/(page=${page.number}-1)}" th:unless="${page.first}">上一页</a>
                </div>
                <div class="right aligned column">
                    <a class="ui mini teal basic button" th:href="@{/admin/tags/(page=${page.number}+1)}" th:unless="${page.last}">下一页</a>
                </div>
            </div>
        </div>
    </div>
</div>
<br>
<br>
<!--底部footer-->
<footer th:replace="_fragments :: footer"></footer>

<!--/*/<th:block th:replace="_fragments :: script">/*/-->
<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
<!--/*/</th:block>/*/-->
<script>
    $('.menu.toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-hide');
    });

</script>
</body>
</html>